package com.qdoner.datarecept.utils;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

public class HttpClientResult implements Serializable {
    private static final long serialVersionUID = 2168152194164783950L;

    /**
     * 响应状态码
     */
    private int code;

    /**
     * 响应数据
     */
    private Object content;

    public HttpClientResult() {

    }

    public HttpClientResult(int code) {
        this.code = code;
    }

    public HttpClientResult(Object content) {
        this.content = content;
    }

    public HttpClientResult(int code, Object content) {
        this.code = code;
        this.content = content;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public JSONObject getContent() {
        return (JSONObject) content;
    }
    public String getStringContent() {
        return  String.valueOf(content);
    }
    public void setContent(Object content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "HttpClientResult [code=" + code + ", content=" + content + "]";
    }

}
